package com.csdj.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.csdj.pojo.IvArchive;
import com.csdj.service.IvArchiveService;
import com.csdj.mapper.IvArchiveMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
* @author 叶涵
* @description 针对表【iv_archive】的数据库操作Service实现
* @createDate 2023-08-24 15:13:39
*/
@Service
public class IvArchiveServiceImpl extends ServiceImpl<IvArchiveMapper, IvArchive>
    implements IvArchiveService{

    @Autowired
    private IvArchiveMapper ivArchiveMapper;
    @Override
    public int countByStartNoAndEndNo(int startNo, int EndNo) {
        LambdaQueryWrapper<IvArchive> lq=new LambdaQueryWrapper<>();
        lq.between(IvArchive::getStartNo,startNo,EndNo).or().between(IvArchive::getEndNo,startNo,EndNo).or().le(IvArchive::getStartNo,startNo).ge(IvArchive::getEndNo,EndNo);
        Long count = count(lq);
        return count.intValue();
    }

    @Override
    public Page<Map> listmap(Page<Map> page) {
        return ivArchiveMapper.listmap(page);
    }
}




